package org.example.decorator;

import org.example.decorator.saparator.Separator;

/**
 * @author Stranger
 * @version 1.0
 * @description: TODO
 * @date 2022/11/6 20:30
 */
public class PrintDecorator implements Print {

    Print print;

    Separator before;

    Separator after;

    public void decoratorPrint(Separator before, Separator after) {

    }

    public PrintDecorator(Print print, Separator before, Separator after) {
        this.print = print;
        this.before = before;
        this.after = after;
    }

    public void print() {
        if (before != null) {
            for (int i = 0; i < 10; i++) System.out.print(before.getSeparator());
            System.out.println();
        }
        print.print();
        if (after != null) {
            for (int i = 0; i < 10; i++) System.out.print(after.getSeparator());
            System.out.println();
        }
    }
}
